PROJECT (Charts)

IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK REQUIRED)
IF(NOT vtkChartsCore_LOADED)
  MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires vtkChartsCore module.")
ENDIF()
INCLUDE(${VTK_USE_FILE})
ENDIF()

IF(vtkViewsInfovis_LOADED AND vtkViewsContext2D_LOADED)
  ADD_EXECUTABLE(GraphItem GraphItem.cxx vtkGraphItem.cxx)
  set_property(TARGET GraphItem APPEND
    PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
  set_property(TARGET GraphItem APPEND
    PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
  TARGET_LINK_LIBRARIES(GraphItem ${VTK_LIBRARIES})
ENDIF()

IF(vtkViewsContext2D_LOADED)
  ADD_EXECUTABLE(PiecewiseItem PiecewiseItem.cxx)
  set_property(TARGET PiecewiseItem APPEND
    PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
  set_property(TARGET PiecewiseItem APPEND
    PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
  TARGET_LINK_LIBRARIES(PiecewiseItem ${VTK_LIBRARIES})
ENDIF()

IF(vtkGUISupportQt_LOADED)
  if(VTK_QT_VERSION VERSION_GREATER "4")
    ADD_EXECUTABLE(QChartTable QChartTable.cxx)
    set_property(TARGET QChartTable APPEND
      PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
    set_property(TARGET QChartTable APPEND
      PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(QChartTable ${VTK_LIBRARIES})

    ADD_EXECUTABLE(QScalarsToColors QScalarsToColors.cxx)
    set_property(TARGET QScalarsToColors APPEND
      PROPERTY COMPILE_DEFINITIONS "${VTK_DEFINITIONS}")
    set_property(TARGET QScalarsToColors APPEND
      PROPERTY INCLUDE_DIRECTORIES ${VTK_INCLUDE_DIRS})
    TARGET_LINK_LIBRARIES(QScalarsToColors ${VTK_LIBRARIES})
  endif()
ENDIF()
